Method of successive bisections
In order to work out the roots of the continuous algebraic equations of the model by the bisection method, it is necessary to make an initial guess of the intervals of the hydrogen ion concentration, (X1,X2), where the roots can be found. In the present particular case, such a guess is made from the very physical conditions of the problem. Indeed, the only interesting roots are real and positive and are between well-defined limits.
The minimum of the interval, X1, is always X1=0 for there are no negative concentrations. As for he maximum of the interval, X2, before the equivalence point, a good guess is:
X2=AT + (Kw)1/2
that corresponds to the virtual complete ionization of the acid, taking
also into account the hydrogen ions from the water auto-ionization.
At, and after the equivalence point X2 is not greater than 10- 7 for the acid has been completely neutralized and the pH is between 7 ([H3O+]=10- 7) and ≈14 ([H3O+]=10- 14). So, a good guess is X2=10- 7.
Once the initial interval is set up, its middle point is:
xm=(X1+X2)/2
Then, a search proceeds in order to determine the subinterval (X1,xm) or (xm,X2) where the root remains. This is done by the well-known theorem of mathematical analysis: "if a continous function f(x) has a unique root in the interval (x1,x2) then f(x1)*f(x2) < 0". Such result is intuitive: when the plot of a function intersepts the x-axis at a point (the root) the function changes its sign.
Now, if the root is in (X1,xm) then X2=xm; else X1=xm. The successive bisections go on until the lenght of the interval |X1-X2| is less than a pre-defined tolerance value where the iterations stop. Then, the root value is assumed to be (X1+X2)/2.